package com.youxue.teachin.set.main.binder;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.library.xtype.DefaultNuwaItemBinder;
import com.youxue.teachin.R;
import com.youxue.teachin.set.main.vo.TitleVO;

/**
 * 在此写用途
 *
 * @author: zhiwei
 * @date: 2017-10-06 10:12
 * @version: 9.1.0
 */
public class TitleBinder extends DefaultNuwaItemBinder<TitleVO> {
    private View mRootView;
    private TextView mTitle;

    @Override
    public View onCreateView(View convertView, ViewGroup parent, LayoutInflater inflater) {
        View view = inflater.inflate(R.layout.title_binder_layout, parent, false);
        initView(view);
        return view;
    }

    @Override
    public void onBindView(int positionOfFeeds, View convertView, ViewGroup parent, TitleVO vo) {
        mTitle.setText(vo.mTitle);
    }

    private void initView(View rootView) {
        mRootView = rootView;
        mTitle = (TextView)rootView.findViewById(R.id.title);
    }
}
